<header class="uc_head">
	<h3>地图</h3>
</header>
{js:jquery}

<table>
	<tr>
		<td><input type="text" name="" id="ss"></td>
		<td><input type="button" name="" value="搜索" id="ditu"></td>
		<td><input type="button" name="" value="全景地图" id="quanjing"></td>
	</tr>
</table>

<div id="rongqi" style="width: 300px;height: 500px;"></div>

<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=VI0LLWYps2Gjk3z7Pip7humGqmLtMMqL"></script>

<script type="text/javascript">
	var	qj = '';

	$("#quanjing").click(function(){
		 var panorama = new BMap.Panorama('rongqi'); //默认为显示导航控件 
		  panorama.setPosition(new BMap.Point(qj.lng, qj.lat));

		  document.getElementById("hideNavigationControl").onclick = function(){ 
		    panorama.setOptions({
		      navigationControl: false //隐藏导航控件
		    });
		  };
		  document.getElementById("showNavigationControl").onclick = function(){ 
			    panorama.setOptions({
			      navigationControl: true //显示导航控件
			    });
  			};
	})

	$("#ditu").click(function(){
	var url = $("#ss").val();
		// 百度地图API功能
	var map = new BMap.Map("rongqi");
	var point = new BMap.Point(116.331398,39.897445);
	map.centerAndZoom(point,12);
	// 创建地址解析器实例
	var myGeo = new BMap.Geocoder();
	// 将地址解析结果显示在地图上,并调整地图视野
	myGeo.getPoint(url, function(point){
		qj = point;
		if (point) {
			map.centerAndZoom(point, 16);
			map.addOverlay(new BMap.Marker(point));
		}else{
			alert("您选择地址没有解析到结果!");
		}
	}, "北京市");
	})
	
</script>
 
